<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs">
<head>
<title>C++ 具名要求：序列容器 (SequenceContainer) </title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.21.2">
<link rel="shortcut icon" href="../../../common/favicon.ico">
<link rel="stylesheet" href="../../../common/ext.css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../common/site_modules.css">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}#toc{display:none}.editsection{display:none}
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-css:7:15cea3ec788a65b5187d4018eed543bf */</style>

<script src="../../../common/startup_scripts.js"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"cpp/named_req/SequenceContainer","wgTitle":"cpp/named req/SequenceContainer","wgCurRevisionId":61533,"wgArticleId":1593,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"zh","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"zh","wgMonthNames":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgMonthNamesShort":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgRelevantPageName":"cpp/named_req/SequenceContainer","wgUserVariant":"zh","wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"zh","language":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"gadget-MathJax":1,"gadget-ColiruCompiler":1});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});;},{},{});
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-js:7:258d7cd6aa9aa67dee25e01fb6a9e505 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<style type="text/css">/*<![CDATA[*/
.source-cpp {line-height: normal;}
.source-cpp li, .source-cpp pre {
	line-height: normal; border: 0px none white;
}
/**
 * GeSHi Dynamically Generated Stylesheet
 * --------------------------------------
 * Dynamically generated stylesheet for cpp
 * CSS class: source-cpp, CSS id: 
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 * --------------------------------------
 */
.cpp.source-cpp .de1, .cpp.source-cpp .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.cpp.source-cpp  {font-family:monospace;}
.cpp.source-cpp .imp {font-weight: bold; color: red;}
.cpp.source-cpp li, .cpp.source-cpp .li1 {font-weight: normal; vertical-align:top;}
.cpp.source-cpp .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.cpp.source-cpp .li2 {font-weight: bold; vertical-align:top;}
.cpp.source-cpp .kw1 {color: #0000dd;}
.cpp.source-cpp .kw2 {color: #0000ff;}
.cpp.source-cpp .kw3 {color: #0000dd;}
.cpp.source-cpp .kw4 {color: #0000ff;}
.cpp.source-cpp .co1 {color: #909090;}
.cpp.source-cpp .co2 {color: #339900;}
.cpp.source-cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp.source-cpp .es0 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es1 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es2 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es3 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es4 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es5 {color: #008000; font-weight: bold;}
.cpp.source-cpp .br0 {color: #008000;}
.cpp.source-cpp .sy0 {color: #008000;}
.cpp.source-cpp .sy1 {color: #000080;}
.cpp.source-cpp .sy2 {color: #000040;}
.cpp.source-cpp .sy3 {color: #000040;}
.cpp.source-cpp .sy4 {color: #008080;}
.cpp.source-cpp .st0 {color: #008000;}
.cpp.source-cpp .nu0 {color: #000080;}
.cpp.source-cpp .nu6 {color: #000080;}
.cpp.source-cpp .nu8 {color: #000080;}
.cpp.source-cpp .nu12 {color: #000080;}
.cpp.source-cpp .nu16 {color:#000080;}
.cpp.source-cpp .nu17 {color:#000080;}
.cpp.source-cpp .nu18 {color:#000080;}
.cpp.source-cpp .nu19 {color:#000080;}
.cpp.source-cpp .ln-xtra, .cpp.source-cpp li.ln-xtra, .cpp.source-cpp div.ln-xtra {background-color: #ffc;}
.cpp.source-cpp span.xtra { display:block; }

/*]]>*/
</style><!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]--></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_named_req_SequenceContainer skin-cppreference2 action-view cpp-navbar">
        <!-- header -->
        <!-- /header -->
        <!-- content -->
<div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">C++ 具名要求：</span><span style="font-style:italic">序列容器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(SequenceContainer)</span> </h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">来自cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../cpp.html" title="cpp">cpp</a>‎ | <a href="../named_req.html" title="cpp/named req">named req</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr"><div class="t-navbar" style=""><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../cpp.html" title="cpp"> C++</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="../language.html" title="cpp/language">语言</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../header.html" title="cpp/header">标准库头文件</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../freestanding.html" title="cpp/freestanding"> 自立与有宿主实现</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../named_req.html" title="cpp/named req">具名要求</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../utility.html#.E8.AF.AD.E8.A8.80.E6.94.AF.E6.8C.81" title="cpp/utility">语言支持库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../concepts.html" title="cpp/concepts">概念库</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../error.html" title="cpp/error">诊断库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../utility.html" title="cpp/utility">工具库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../string.html" title="cpp/string">字符串库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../container.html" title="cpp/container">容器库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../iterator.html" title="cpp/iterator">迭代器库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../ranges.html" title="cpp/ranges"> 范围库</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../algorithm.html" title="cpp/algorithm">算法库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../numeric.html" title="cpp/numeric">数值库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../locale.html" title="cpp/locale">本地化库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../io.html" title="cpp/io">输入/输出库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../filesystem.html" title="cpp/filesystem">文件系统库</a> <span class="t-mark-rev t-since-cxx17">(C++17)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../regex.html" title="cpp/regex">正则表达式库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../atomic.html" title="cpp/atomic">原子操作库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../thread.html" title="cpp/thread">线程支持库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../experimental.html" title="cpp/experimental">技术规范</a> </td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../named_req.html" title="cpp/named req">C++ 具名要求</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv-h1"><td colspan="5"> 基础</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="DefaultConstructible.html" title="cpp/named req/DefaultConstructible"><span class="t-lines"><span>DefaultConstructible</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="CopyAssignable.html" title="cpp/named req/CopyAssignable"><span class="t-lines"><span>CopyAssignable</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="CopyConstructible.html" title="cpp/named req/CopyConstructible"><span class="t-lines"><span>CopyConstructible</span></span></a></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="MoveAssignable.html" title="cpp/named req/MoveAssignable"><span class="t-lines"><span>MoveAssignable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="MoveConstructible.html" title="cpp/named req/MoveConstructible"><span class="t-lines"><span>MoveConstructible</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Destructible.html" title="cpp/named req/Destructible"><span class="t-lines"><span>Destructible</span></span></a></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> 类型属性</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="TrivialType.html" title="cpp/named req/TrivialType"><span class="t-lines"><span>TrivialType</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="TriviallyCopyable.html" title="cpp/named req/TriviallyCopyable"><span class="t-lines"><span>TriviallyCopyable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="StandardLayoutType.html" title="cpp/named req/StandardLayoutType"><span class="t-lines"><span>StandardLayoutType</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="PODType.html" title="cpp/named req/PODType"><span class="t-lines"><span>PODType</span></span></a></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> 库所属</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="EqualityComparable.html" title="cpp/named req/EqualityComparable"><span class="t-lines"><span>EqualityComparable</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="LessThanComparable.html" title="cpp/named req/LessThanComparable"><span class="t-lines"><span>LessThanComparable</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Swappable.html" title="cpp/named req/Swappable"><span class="t-lines"><span>Swappable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="ValueSwappable.html" title="cpp/named req/ValueSwappable"><span class="t-lines"><span>ValueSwappable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="NullablePointer.html" title="cpp/named req/NullablePointer"><span class="t-lines"><span>NullablePointer</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Hash.html" title="cpp/named req/Hash"><span class="t-lines"><span>Hash</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Allocator.html" title="cpp/named req/Allocator"><span class="t-lines"><span>Allocator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="FunctionObject.html" title="cpp/named req/FunctionObject"><span class="t-lines"><span>FunctionObject</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Callable.html" title="cpp/named req/Callable"><span class="t-lines"><span>Callable</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Predicate.html" title="cpp/named req/Predicate"><span class="t-lines"><span>Predicate</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="BinaryPredicate.html" title="cpp/named req/BinaryPredicate"><span class="t-lines"><span>BinaryPredicate</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Compare.html" title="cpp/named req/Compare"><span class="t-lines"><span>Compare</span></span></a></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> 容器</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Container.html" title="cpp/named req/Container"><span class="t-lines"><span>Container</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><strong class="selflink"><span class="t-lines"><span>SequenceContainer</span></span></strong></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="ContiguousContainer.html" title="cpp/named req/ContiguousContainer"><span class="t-lines"><span>ContiguousContainer</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="ReversibleContainer.html" title="cpp/named req/ReversibleContainer"><span class="t-lines"><span>ReversibleContainer</span></span></a></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="AssociativeContainer.html" title="cpp/named req/AssociativeContainer"><span class="t-lines"><span>AssociativeContainer</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="AllocatorAwareContainer.html" title="cpp/named req/AllocatorAwareContainer"><span class="t-lines"><span>AllocatorAwareContainer</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="UnorderedAssociativeContainer.html" title="cpp/named req/UnorderedAssociativeContainer"><span class="t-lines"><span>UnorderedAssociativeContainer</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 容器元素</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="DefaultInsertable.html" title="cpp/named req/DefaultInsertable"><span class="t-lines"><span>DefaultInsertable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span class="t-lines"><span>CopyInsertable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="MoveInsertable.html" title="cpp/named req/MoveInsertable"><span class="t-lines"><span>MoveInsertable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="EmplaceConstructible.html" title="cpp/named req/EmplaceConstructible"><span class="t-lines"><span>EmplaceConstructible</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Erasable.html" title="cpp/named req/Erasable"><span class="t-lines"><span>Erasable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> 迭代器</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Iterator.html" title="cpp/named req/Iterator"><span class="t-lines"><span>LegacyIterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="OutputIterator.html" title="cpp/named req/OutputIterator"><span class="t-lines"><span>LegacyOutputIterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="InputIterator.html" title="cpp/named req/InputIterator"><span class="t-lines"><span>LegacyInputIterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="ForwardIterator.html" title="cpp/named req/ForwardIterator"><span class="t-lines"><span>LegacyForwardIterator</span></span></a></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="BidirectionalIterator.html" title="cpp/named req/BidirectionalIterator"><span class="t-lines"><span>LegacyBidirectionalIterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="RandomAccessIterator.html" title="cpp/named req/RandomAccessIterator"><span class="t-lines"><span>LegacyRandomAccessIterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="ContiguousIterator.html" title="cpp/named req/ContiguousIterator"><span class="t-lines"><span>LegacyContiguousIterator</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="ConstexprIterator.html" title="cpp/named req/ConstexprIterator"><span class="t-lines"><span>ConstexprIterator</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> 流 I/O</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="FormattedInputFunction.html" title="cpp/named req/FormattedInputFunction"><span class="t-lines"><span>FormattedInputFunction</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="UnformattedInputFunction.html" title="cpp/named req/UnformattedInputFunction"><span class="t-lines"><span>UnformattedInputFunction</span></span></a></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="FormattedOutputFunction.html" title="cpp/named req/FormattedOutputFunction"><span class="t-lines"><span>FormattedOutputFunction</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="UnformattedOutputFunction.html" title="cpp/named req/UnformattedOutputFunction"><span class="t-lines"><span>UnformattedOutputFunction</span></span></a></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> 随机数</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="SeedSequence.html" title="cpp/named req/SeedSequence"><span class="t-lines"><span>SeedSequence</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="RandomNumberEngine.html" title="cpp/named req/RandomNumberEngine"><span class="t-lines"><span>RandomNumberEngine</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="RandomNumberDistribution.html" title="cpp/named req/RandomNumberDistribution"><span class="t-lines"><span>RandomNumberDistribution</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="UniformRandomBitGenerator.html" title="cpp/named req/UniformRandomBitGenerator"><span class="t-lines"><span>UniformRandomBitGenerator</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="RandomNumberEngineAdaptor.html" title="cpp/named req/RandomNumberEngineAdaptor"><span class="t-lines"><span>RandomNumberEngineAdaptor</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> 并发</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="BasicLockable.html" title="cpp/named req/BasicLockable"><span class="t-lines"><span>BasicLockable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Lockable.html" title="cpp/named req/Lockable"><span class="t-lines"><span>Lockable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="TimedLockable.html" title="cpp/named req/TimedLockable"><span class="t-lines"><span>TimedLockable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="SharedLockable.html" title="cpp/named req/SharedLockable"><span class="t-lines"><span>SharedLockable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx14">(C++14)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="SharedTimedLockable.html" title="cpp/named req/SharedTimedLockable"><span class="t-lines"><span>SharedTimedLockable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx14">(C++14)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Mutex.html" title="cpp/named req/Mutex"><span class="t-lines"><span>Mutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="TimedMutex.html" title="cpp/named req/TimedMutex"><span class="t-lines"><span>TimedMutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="SharedMutex.html" title="cpp/named req/SharedMutex"><span class="t-lines"><span>SharedMutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="SharedTimedMutex.html" title="cpp/named req/SharedTimedMutex"><span class="t-lines"><span>SharedTimedMutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx14">(C++14)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> 其他</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="CharTraits.html" title="cpp/named req/CharTraits"><span class="t-lines"><span>CharTraits</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="RegexTraits.html" title="cpp/named req/RegexTraits"><span class="t-lines"><span>RegexTraits</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="BitmaskType.html" title="cpp/named req/BitmaskType"><span class="t-lines"><span>BitmaskType</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="NumericType.html" title="cpp/named req/NumericType"><span class="t-lines"><span>NumericType</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="LiteralType.html" title="cpp/named req/LiteralType"><span class="t-lines"><span>LiteralType</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="UnaryTypeTrait.html" title="cpp/named req/UnaryTypeTrait"><span class="t-lines"><span>UnaryTypeTrait</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="BinaryTypeTrait.html" title="cpp/named req/BinaryTypeTrait"><span class="t-lines"><span>BinaryTypeTrait</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="TransformationTrait.html" title="cpp/named req/TransformationTrait"><span class="t-lines"><span>TransformationTrait</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="Clock.html" title="cpp/named req/Clock"><span class="t-lines"><span>Clock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-named-req-table"><div><a href="TrivialClock.html" title="cpp/named req/TrivialClock"><span class="t-lines"><span>TrivialClock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div></div>
<p><strong class="selflink"><span style="font-style:italic">序列容器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(SequenceContainer)</span> </strong>是在线性排列中存储相同类型对象的<a href="Container.html" title="cpp/named req/Container"><span style="font-style:italic">容器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(Container)</span> </a>。
</p>
<h3><span class="mw-headline" id=".E8.A6.81.E6.B1.82">要求</span></h3>
<p>以下情况下，类型 <code>X</code> 满足<strong class="selflink"><span style="font-style:italic">序列容器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(SequenceContainer)</span> </strong>
</p>
<ul><li> 类型 <code>X</code> 满足<a href="Container.html" title="cpp/named req/Container"><span style="font-style:italic">容器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(Container)</span> </a>，且
</li></ul>
<p>给定
</p>
<ul><li> <code>T</code>，为 <code>X</code> 的元素类型
</li><li> <code>A</code>，为 <code>X</code> 的分配器类型：若存在则为 <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy4">::</span><span class="me2">allocator_type</span></span></span>，否则为 <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../memory/allocator.html"><span class="kw700">std::<span class="me2">allocator</span></span></a><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span></span></span>
</li><li> <code>a</code>，为 <code>X</code> 类型的<a href="../language/value_category.html" title="cpp/language/value category">左值</a>表达式 
</li><li> <code>p</code>，<code>a</code> 中的有效常量迭代器
</li><li> <code>q</code>，<code>a</code> 中的有效可解引用常量迭代器
</li><li> <code>q1</code> 与 <code>q2</code>，为 <code>a</code> 中的两个有效常量迭代器，并使得 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="br0">[</span>q1, q2<span class="br0">)</span></span></span> 是有效范围
</li><li> <code>i</code> 与 <code>j</code>，为<a href="InputIterator.html" title="cpp/named req/InputIterator"><span style="font-style:italic">老式输入迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(LegacyInputIterator)</span> </a>，使得 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="br0">[</span>i, j<span class="br0">)</span></span></span> 是有效范围，且各迭代器指代能隐式转换成 <code>value_type</code> 的对象
</li><li> <code>il</code>，为 <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../utility/initializer_list.html"><span class="kw960">std::<span class="me2">initializer_list</span></span></a><span class="sy1">&lt;</span>value_type<span class="sy1">&gt;</span></span></span> 类型的对象
</li><li> <code>n</code>，为 <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy4">::</span><span class="me2">size_type</span></span></span> 类型的值
</li><li> <code>t</code>，为 <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy4">::</span><span class="me2">value_type</span></span></span> 类型的左值或 const 右值
</li><li> <code>rv</code>，为 <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy4">::</span><span class="me2">value_type</span></span></span> 类型的非 const 右值
</li><li> <code>Args</code>：模板形参包
</li><li> <code>args</code>：拥有模式 <span class="t-c"><span class="mw-geshi cpp source-cpp">Arg<span class="sy3">&amp;&amp;</span></span></span> 的函数形参包
</li></ul>
<p>下列表达式必须合法，且对除 <span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span> 之外的所有顺序容器均具有所指定的效果：
</p>
<table class="wikitable">
<tr>
<th>表达式</th>
<th>返回类型</th>
<th>效果</th>
<th>前条件</th>
<th>后条件
</th></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="br0">(</span>n, t<span class="br0">)</span></span></span>
<p><span class="t-c"><span class="mw-geshi cpp source-cpp">X a<span class="br0">(</span>n, t<span class="br0">)</span></span></span>
</p>
</td>
<td>
</td>
<td>构造保有 <code><b>n</b></code> 个 <code><b>t</b></code> 的副本的容器
</td>
<td><code>T</code> <a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span style="font-style:italic">可复制插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyInsertable)</span> </a>到 <code>X</code>
</td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../iterator/distance.html"><span class="kw673">std::<span class="me2">distance</span></span></a><span class="br0">(</span>begin<span class="br0">(</span><span class="br0">)</span>,end<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy1">==</span> n</span></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="br0">(</span>i, j<span class="br0">)</span></span></span>
<p><span class="t-c"><span class="mw-geshi cpp source-cpp">X a<span class="br0">(</span>i, j<span class="br0">)</span></span></span>
</p>
</td>
<td>
</td>
<td>构造与范围 <code>[i,j)</code> 逐元素相等的顺序容器
</td>
<td> <code>T</code> 从 <code>*i</code> <a href="EmplaceConstructible.html" title="cpp/named req/EmplaceConstructible"><span style="font-style:italic">可就位构造</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(EmplaceConstructible)</span> </a>到 <code>X</code> 中
<p><span class="t-mark">(仅对 std::vector)</span>若各迭代器不是<a href="ForwardIterator.html" title="cpp/named req/ForwardIterator"><span style="font-style:italic">老式向前迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(LegacyForwardIterator)</span> </a>，则 <code>T</code> 必须<a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span style="font-style:italic">可复制插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyInsertable)</span> </a>
</p>
</td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../iterator/distance.html"><span class="kw673">std::<span class="me2">distance</span></span></a><span class="br0">(</span>begin<span class="br0">(</span><span class="br0">)</span>,end<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy1">==</span> <a href="../iterator/distance.html"><span class="kw673">std::<span class="me2">distance</span></span></a><span class="br0">(</span>i,j<span class="br0">)</span></span></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="br0">(</span>il<span class="br0">)</span></span></span></td>
<td> </td>
<td> <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="br0">(</span>il.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span>, il.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span></td>
<td> </td>
<td>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a <span class="sy1">=</span> il</span></span></td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy3">&amp;</span></span></span></td>
<td>将 <code><b>il</b></code> 所表示的范围赋值到 <code><b>a</b></code> 中<sup id="cite_ref-1" class="reference"><a href="SequenceContainer.html#cite_note-1">[1]</a></sup>
</td>
<td><code>T</code> <a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span style="font-style:italic">可复制插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyInsertable)</span> </a>且<a href="CopyAssignable.html" title="cpp/named req/CopyAssignable"><span style="font-style:italic">可复制赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyAssignable)</span> </a>
</td>
<td><code><b>a</b></code> 的既存元素被销毁或被赋值
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">emplace</span><span class="br0">(</span>p,args<span class="br0">)</span></span></span></td>
<td><code>iterator</code>
</td>
<td>在 <code><b>p</b></code> 前插入以 <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../utility/forward.html"><span class="kw1117">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>Args<span class="sy1">&gt;</span><span class="br0">(</span>args<span class="br0">)</span></span></span> 构造的 <code>T</code> 类型的对象
</td>
<td><code>T</code> <a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span style="font-style:italic">可复制插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyInsertable)</span> </a>
<p><span class="t-mark">(对 std::vector 与 std::deque)</span> <code>T</code> <a href="MoveAssignable.html" title="cpp/named req/MoveAssignable"><span style="font-style:italic">可移动赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveAssignable)</span> </a>且<a href="MoveInsertable.html" title="cpp/named req/MoveInsertable"><span style="font-style:italic">可移动插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveInsertable)</span> </a>
</p>
</td>
<td>返回指向由 <code>args</code> 构造到 <code>a</code> 中的元素的迭代器
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,t<span class="br0">)</span></span></span></td>
<td><code>iterator</code>
</td>
<td>在 <code><b>p</b></code> 前插入 <code><b>t</b></code> 的副本
</td>
<td><code>T</code> <a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span style="font-style:italic">可复制插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyInsertable)</span> </a>
<p><span class="t-mark">(对 std::vector 与 std::deque)</span> <code>T</code> <a href="CopyAssignable.html" title="cpp/named req/CopyAssignable"><span style="font-style:italic">可复制赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyAssignable)</span> </a>或<a href="MoveAssignable.html" title="cpp/named req/MoveAssignable"><span style="font-style:italic">可移动赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveAssignable)</span> </a>
</p>
</td>
<td>返回指向插入到 <code>a</code> 中的 <code>t</code> 的副本的迭代器
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,rv<span class="br0">)</span></span></span></td>
<td><code>iterator</code>
</td>
<td>在 <code><b>p</b></code> 前插入 <code><b>rv</b></code> 的副本，可能用移动语义
</td>
<td><code>T</code> <a href="MoveInsertable.html" title="cpp/named req/MoveInsertable"><span style="font-style:italic">可移动插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveInsertable)</span> </a>
<p><span class="t-mark">(对 std::vector 与 std::deque)</span> <code>T</code> <a href="MoveAssignable.html" title="cpp/named req/MoveAssignable"><span style="font-style:italic">可移动赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveAssignable)</span> </a>
</p>
</td>
<td>返回指向插入到 <code>a</code> 中的 <code>rv</code> 的副本的迭代器
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,n,t<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td>插入 <code><b>n</b></code> 个 <code><b>t</b></code> 的副本到 <code><b>p</b></code> 之前
</td>
<td><code>T</code> <a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span style="font-style:italic">可复制插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyInsertable)</span> </a>且<a href="CopyAssignable.html" title="cpp/named req/CopyAssignable"><span style="font-style:italic">可复制赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyAssignable)</span> </a>
</td>
<td>返回指向插入到 <code>a</code> 中的首元素的副本的迭代器，或当 <span class="t-c"><span class="mw-geshi cpp source-cpp">n<span class="sy1">==</span><span class="nu0">0</span></span></span> 时为 <code>p</code>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,i,j<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td>插入 <code>[i, j)</code> 中元素的副本到 <code><b>p</b></code> 之前
</td>
<td> <code>T</code> <a href="EmplaceConstructible.html" title="cpp/named req/EmplaceConstructible"><span style="font-style:italic">可就位构造</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(EmplaceConstructible)</span> </a>且 <code><b>i</b></code> 与 <code><b>j</b></code> 不在 <code><b>a</b></code> 中
<p><span class="t-mark">(仅对 std::vector)</span>若迭代器不是<a href="ForwardIterator.html" title="cpp/named req/ForwardIterator"><span style="font-style:italic">老式向前迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(LegacyForwardIterator)</span> </a>，则 <code>T</code> 必须<a href="MoveInsertable.html" title="cpp/named req/MoveInsertable"><span style="font-style:italic">可移动插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveInsertable)</span> </a>且<a href="MoveAssignable.html" title="cpp/named req/MoveAssignable"><span style="font-style:italic">可移动赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveAssignable)</span> </a>
</p>
</td>
<td><code>[i,j)</code> 中的每个迭代器被解引用一次。返回指向插入到 <code>a</code> 的首元素的副本的迭代器，或当 <span class="t-c"><span class="mw-geshi cpp source-cpp">i<span class="sy1">==</span>j</span></span> 时为 <code>p</code>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p, il<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,il.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span>,il.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span></td>
<td> </td>
<td>返回指向插入到 <code>a</code> 中的首元素的副本的迭代器，或若 <code>il</code> 为空则为 <code>p</code>。
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">erase</span><span class="br0">(</span>q<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td>擦除 <code>q</code> 所指向的元素
</td>
<td><span class="t-mark">(std::deque, std::vector)</span> <code>T</code> <a href="MoveAssignable.html" title="cpp/named req/MoveAssignable"><span style="font-style:italic">可移动赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveAssignable)</span> </a>
</td>
<td>返回指向擦除前紧跟 <code>q</code> 之后的元素的迭代器，或若此种元素不存在则返回 <span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span></span></span>。
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">erase</span><span class="br0">(</span>q1,q2<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td>擦除 <code>[q1,q2)</code> 中的元素</td>
<td><span class="t-mark">(std::deque, std::vector)</span> <code>T</code> <a href="MoveAssignable.html" title="cpp/named req/MoveAssignable"><span style="font-style:italic">可移动赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveAssignable)</span> </a></td>
<td>返回指向在任何擦除前 <code>q2</code> 曾指向的元素的迭代器，或若不存在此种元素则返回 <span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span></span></span>。
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">clear</span><span class="br0">(</span><span class="br0">)</span></span></span></td>
<td><code>void</code></td>
<td>销毁 <code><b>a</b></code> 中所有元素</td>
<td> </td>
<td>
<p>所有引用、指针及迭代器均失效，包含尾迭代器。<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">empty</span><span class="br0">(</span><span class="br0">)</span> <span class="sy1">==</span> <span class="kw2">true</span></span></span>。
</p>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">assign</span><span class="br0">(</span>i,j<span class="br0">)</span></span></span></td>
<td><code>void</code></td>
<td>以 <code>[i, j)</code> 的副本替换 a 中的元素
</td>
<td><code>T</code> <a href="EmplaceConstructible.html" title="cpp/named req/EmplaceConstructible"><span style="font-style:italic">可就位构造</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(EmplaceConstructible)</span> </a>，且 <code><b>i</b></code>、<code><b>j</b></code> 不在 <code><b>a</b></code> 中
<p><span class="t-mark">(std::vector)</span>，若非<a href="ForwardIterator.html" title="cpp/named req/ForwardIterator"><span style="font-style:italic">老式向前迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(LegacyForwardIterator)</span> </a>，则 <code>T</code> <a href="MoveInsertable.html" title="cpp/named req/MoveInsertable"><span style="font-style:italic">可移动插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveInsertable)</span> </a>
</p>
</td>
<td><code>[i,j)</code> 中的每个迭代器被解引用一次
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">assign</span><span class="br0">(</span>il<span class="br0">)</span></span></span></td>
<td><code>void</code></td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">assign</span><span class="br0">(</span>il.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span>,il.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span></td>
<td> </td>
<td>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">assign</span><span class="br0">(</span>n,t<span class="br0">)</span></span></span></td>
<td><code>void</code>
</td>
<td>用 <code><b>t</b></code> 的 <code><b>n</b></code> 个副本替换 <code><b>a</b></code> 中的元素
</td>
<td><code>T</code> <a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span style="font-style:italic">可复制插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyInsertable)</span> </a>并<a href="CopyAssignable.html" title="cpp/named req/CopyAssignable"><span style="font-style:italic">可复制赋值</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyAssignable)</span> </a>
</td>
<td>
</td></tr>
<tr>
<th colspan="5">注
</th></tr>
<tr>
<td colspan="5"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="SequenceContainer.html#cite_ref-1">↑</a></span> <span class="reference-text"><span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span> 支持从花括号初始化器列表复制，但不支持从 <span class="t-lc"><a href="../utility/initializer_list.html" title="cpp/utility/initializer list">std::initializer_list</a></span> 赋值</span>
</li>
</ol>
</td></tr></table>
<p>下列表达式必须合法，且对于所指名的顺序容器拥有所指定的效果：
</p>
<table class="wikitable">
<tr>
<th>表达式</th>
<th>返回类型</th>
<th>效果</th>
<th>前条件</th>
<th>容器
</th></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">front</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td><code>reference</code>
<p>对于 const a 为 <code>const_reference</code>
</p>
</td>
<td>等价于 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span>a.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td>
</td>
<td>（全部）
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">back</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td><code>reference</code>
<p>对于 const a 为 <code>const_reference</code>
</p>
</td>
<td>等价于 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="br0">{</span> <span class="kw4">auto</span> tmp <span class="sy1">=</span> a.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="sy2">--</span>tmp<span class="sy4">;</span> <span class="kw1">return</span> <span class="sy2">*</span>tmp<span class="sy4">;</span> <span class="br0">}</span></span></span>
</td>
<td>
</td>
<td><span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">emplace_front</span><span class="br0">(</span>args<span class="br0">)</span></span></span>
</td>
<td><code>void</code>
</td>
<td>前附一个以 <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../utility/forward.html"><span class="kw1117">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>Args<span class="sy1">&gt;</span><span class="br0">(</span>args<span class="br0">)</span>...</span></span> 构造的 <code>T</code>
</td>
<td><code>T</code> 从 <code>args</code> <a href="EmplaceConstructible.html" title="cpp/named req/EmplaceConstructible"><span style="font-style:italic">可就位构造</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(EmplaceConstructible)</span> </a>到 <code>X</code> 中
</td>
<td><span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/forward_list.html" title="cpp/container/forward list">std::forward_list</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">emplace_back</span><span class="br0">(</span>args<span class="br0">)</span></span></span>
</td>
<td><code>void</code>
</td>
<td>后附一个以 <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../utility/forward.html"><span class="kw1117">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>Args<span class="sy1">&gt;</span><span class="br0">(</span>args<span class="br0">)</span>...</span></span> 构造的 <code>T</code>
</td>
<td><code>T</code> 从 <code>args</code> <a href="EmplaceConstructible.html" title="cpp/named req/EmplaceConstructible"><span style="font-style:italic">可就位构造</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(EmplaceConstructible)</span> </a>到 <code>X</code> 中
<p><span class="t-mark">(仅 std::vector)</span> <code>T</code> <a href="MoveInsertable.html" title="cpp/named req/MoveInsertable"><span style="font-style:italic">可移动插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveInsertable)</span> </a>到 <code>X</code> 中
</p>
</td>
<td><span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">push_front</span><span class="br0">(</span>t<span class="br0">)</span></span></span>
</td>
<td><code>void</code>
</td>
<td>前附 <code>t</code> 的一个副本
</td>
<td><code>T</code> <a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span style="font-style:italic">可复制插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyInsertable)</span> </a>到 <code>X</code> 中
</td>
<td><span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/forward_list.html" title="cpp/container/forward list">std::forward_list</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">push_front</span><span class="br0">(</span>rv<span class="br0">)</span></span></span>
</td>
<td><code>void</code>
</td>
<td>前附 <code>rv</code> 的一个副本，可能用移动语义
</td>
<td><code>T</code> <a href="MoveInsertable.html" title="cpp/named req/MoveInsertable"><span style="font-style:italic">可移动插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveInsertable)</span> </a>到 <code>X</code> 中
</td>
<td><span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/forward_list.html" title="cpp/container/forward list">std::forward_list</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">push_back</span><span class="br0">(</span>t<span class="br0">)</span></span></span>
</td>
<td><code>void</code>
</td>
<td>后附 <code>t</code> 的一个副本
</td>
<td><code>T</code> <a href="CopyInsertable.html" title="cpp/named req/CopyInsertable"><span style="font-style:italic">可复制插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(CopyInsertable)</span> </a>到 <code>X</code> 中
</td>
<td><span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">push_back</span><span class="br0">(</span>rv<span class="br0">)</span></span></span>
</td>
<td><code>void</code>
</td>
<td>后附 <code>rv</code> 的一个副本，可能用移动语义
</td>
<td><code>T</code> <a href="MoveInsertable.html" title="cpp/named req/MoveInsertable"><span style="font-style:italic">可移动插入</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(MoveInsertable)</span> </a>到 <code>X</code> 中
</td>
<td><span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">pop_front</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td><code>void</code>
</td>
<td>销毁首元素
</td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">empty</span><span class="br0">(</span><span class="br0">)</span> <span class="sy1">==</span> <span class="kw2">false</span></span></span>
</td>
<td><span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/forward_list.html" title="cpp/container/forward list">std::forward_list</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">pop_back</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td><code>void</code>
</td>
<td>销毁最末元素
</td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">empty</span><span class="br0">(</span><span class="br0">)</span> <span class="sy1">==</span> <span class="kw2">false</span></span></span>
</td>
<td><span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a<span class="br0">[</span>n<span class="br0">]</span></span></span>
</td>
<td><code>reference</code>
<p>对于 const a 为 <code>const_reference</code>
</p>
</td>
<td>等价于 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span><span class="br0">(</span>n <span class="sy2">+</span> a.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span>
</td>
<td>
</td>
<td><span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td></tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">at</span><span class="br0">(</span>n<span class="br0">)</span></span></span>
</td>
<td><code>reference</code>
<p>对于 const a 为 <code>const_reference</code>
</p>
</td>
<td>等价于 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span><span class="br0">(</span>n <span class="sy2">+</span> a.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span>，但若 <span class="t-c"><span class="mw-geshi cpp source-cpp">n<span class="sy1">&gt;=</span>size<span class="br0">(</span><span class="br0">)</span></span></span> 则抛出 <span class="t-lc">out_of_range</span>
</td>
<td>
</td>
<td><span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td></tr></table>
<p>另外，对于每个顺序容器，接收两个输入迭代器的构造函数模板和成员函数 <code>insert()</code>、<code>append()</code>、<code>assign()</code>、<code>replace()</code> 的模板重载，若相应的模板实参不满足<a href="InputIterator.html" title="cpp/named req/InputIterator"><span style="font-style:italic">老式输入迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(LegacyInputIterator)</span> </a>，则它们不参与重载决议。
</p>
<h3><span class="mw-headline" id=".E6.A0.87.E5.87.86.E5.BA.93.E4.B8.AD.E7.9A.84.E9.A1.BA.E5.BA.8F.E5.AE.B9.E5.99.A8">标准库中的顺序容器</span></h3>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../string/basic_string.html" title="cpp/string/basic string"> <span class="t-lines"><span>basic_string</span></span></a></div></div>
</td>
<td>   存储并操作字符序列 <br> <span class="t-mark">(类模板)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../container/array.html" title="cpp/container/array"> <span class="t-lines"><span>array</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   静态的连续数组  <br> <span class="t-mark">(类模板)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../container/vector.html" title="cpp/container/vector"> <span class="t-lines"><span>vector</span></span></a></div></div>
</td>
<td>   动态的连续数组 <br> <span class="t-mark">(类模板)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../container/deque.html" title="cpp/container/deque"> <span class="t-lines"><span>deque</span></span></a></div></div>
</td>
<td>  双端队列 <br> <span class="t-mark">(类模板)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../container/forward_list.html" title="cpp/container/forward list"> <span class="t-lines"><span>forward_list</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11 起)</span></span></span></div></div>
</td>
<td>  单链表 <br> <span class="t-mark">(类模板)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../container/list.html" title="cpp/container/list"> <span class="t-lines"><span>list</span></span></a></div></div>
</td>
<td>  双链表 <br> <span class="t-mark">(类模板)</span> </td></tr>
</table>
<h4><span class="mw-headline" id=".E6.9D.83.E8.A1.A1.2F.E4.BD.BF.E7.94.A8.E5.A4.87.E6.B3.A8">权衡/使用备注</span></h4>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td> std::array
</td>
<td> 快速访问但元素数量固定
</td></tr>


<tr class="t-dsc">
<td> std::vector
</td>
<td> 快速访问但大多情况在插入/删除低效
</td></tr>


<tr class="t-dsc">
<td> std::list<br>std::forward_list
</td>
<td> 在序列中部高效地插入/删除
</td></tr>


<tr class="t-dsc">
<td> std::deque
</td>
<td> 在序列首尾高效地插入/删除
</td></tr>

</table>

<!-- 
NewPP limit report
Preprocessor visited node count: 14409/1000000
Preprocessor generated node count: 13088/1000000
Post‐expand include size: 256109/2097152 bytes
Template argument size: 44919/2097152 bytes
Highest expansion depth: 20/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key mwiki1-mwiki_zh_:pcache:idhash:1593-0!*!0!!*!*!zh!* and timestamp 20211110193846 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    来自“<a href="https://zh.cppreference.com/mwiki/index.php?title=cpp/named_req/SequenceContainer&amp;oldid=61533">https://zh.cppreference.com/mwiki/index.php?title=cpp/named_req/SequenceContainer&amp;oldid=61533</a>”                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        <div id="cpp-footer-base" class="noprint">
            <div id="footer">
                        <div id="cpp-navigation">
            <h5>导航</h5>
            <ul><li><a href="https://zh.cppreference.com/w/cpp/named_req/SequenceContainer">Online version</a></li><li>Offline version retrieved 2022-01-01 00:37.</li></ul></div>
                        <ul id="footer-info">
                                    <li id="footer-info-lastmod"> 本页面最后修改于2019年6月9日 (星期日) 16:31。</li>
                                    <li id="footer-info-viewcount">此页面已被浏览过9,075次。</li>
                            </ul>
                    </div>
        </div>
        <!-- /footer -->
        <script>if(window.mw){
mw.loader.state({"site":"loading","user":"missing","user.groups":"ready"});
}</script>
<script src="../../../common/skin_scripts.js"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.page.ready","mediawiki.searchSuggest","mediawiki.hidpi","ext.gadget.MathJax","ext.gadget.ColiruCompiler"], null, true);
}</script>
<script src="../../../common/site_scripts.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2828341-1']);
_gaq.push(['_setDomainName', 'cppreference.com']);
_gaq.push(['_trackPageview']);
</script><!-- Served in 3.500 secs. -->
	</body>
<!-- Cached 20211110193846 -->
</html>